<script type="text/javascript">
// Check all checkboxes when the one in a table head is checked:
jQuery('.check-all').click(function(){
	jQuery(this).parent().parent().parent().parent().find("input[type='checkbox']").attr('checked', jQuery(this).is(':checked'));
}); 
</script>
<div id="content">	
	<div id="menu-nav-content">
		<div id="menu-nav-content-l"></div>
		<div id="menu-nav-content-r"></div>
		<div id="menu-nav-content-c">
			<div id="menu-nav-content-main">
				<ul>
					<li style="display:block" class="active "><a href=""><span>TÀI KHOẢN BKPAY.VN</span></a></li>
				</ul>
			</div>
			<div id="menu-nav-content-sub">
				<ul>
					<li style="display:block" class="active"><a href="#"><span>Quản trị giao dịch</span></a></li>
					<li style="display:block" class=""><a href="{{$APP_BASE_URL}}transaction/index/recharge"><span>Nạp tiền</span></a></li>
					<li style="display:block" class=""><a href="{{$APP_BASE_URL}}transaction/index/withdraw"><span>Rút tiền</span></a></li>
					<li style="display:block" class=""><a href="{{$APP_BASE_URL}}transaction/index/transfer"><span>Chuyển tiền</span></a></li>
				</ul>
			</div>
		</div>
	</div>
		
	<div id="title">
		<span class="yel">Thông tin tổng hợp </span>
	</div>
	
	<!-- HELPER BAR -->
	{{sticker name=helper_bar}}
	<!-- END HELPER BAR -->
	
	<div id="th-l">
		<div style="width:698px;" id="transaction-history" class="box-content-square">
		
			<!-- MESSAGE -->
			
			{{if null != $registerMessage && true == $registerMessage.success}}
				<div class="notification-success">
					{{$registerMessage.message}}
				</div>
			{{elseif null != $registerMessage && false == $registerMessage.success}}
				<div class="notification-error">
					{{$registerMessage.message}}
				</div>
			{{/if}}
			
			{{if null != $rechargeMessage && true == $rechargeMessage.success}}
				<div class="notification-success">
					{{l}}Timestamp{{/l}}: {{$rechargeMessage.timestamp}}<br/> 
					{{$rechargeMessage.message}}
				</div>
			{{elseif null != $rechargeMessage && false == $rechargeMessage.success}}
				<div class="notification-error">
					{{l}}Timestamp{{/l}}: {{$rechargeMessage.timestamp}}<br/> 
					{{$rechargeMessage.message}}
				</div>
			{{/if}}
			
			{{if null != $transferMessage && true == $transferMessage.success}}
				<div class="notification-success">
					{{l}}Timestamp{{/l}}: {{$transferMessage.timestamp}}<br/> 
					{{$transferMessage.message}}
				</div>
			{{elseif null != $transferMessage && false == $transferMessage.success}}
				<div class="notification-error">
					{{l}}Timestamp{{/l}}: {{$transferMessage.timestamp}}<br/> 
					{{$transferMessage.message}}
				</div>
			{{/if}}
			
			<!-- END MESSAGE -->
		
			<div id="transaction-history-title" style="padding-left: 15px;">
				<strong>Danh sách các giao dịch</strong>
			</div>
			<div style="border-top:0;" id="label-table">		
				<div style=" float:left;height:16px;">
					<span style="color:#555;font-weight:bold;">Biểu tượng:&nbsp;&nbsp;</span>	
					<img align="absmiddle" src="{{$LAYOUT_HELPER_URL}}front/images/icons/visible16x16.png">
					<span>Đã xác thực&nbsp;&nbsp;</span>			 
					<img align="absmiddle" src="{{$LAYOUT_HELPER_URL}}front/images/icons/invisible16x16.png">
					<span>Chưa xác thực&nbsp;&nbsp;</span>
					<img align="absmiddle" src="{{$LAYOUT_HELPER_URL}}front/images/icons/view_detail.png">
					<span>Xem chi tiết&nbsp;&nbsp;</span>
					<img align="absmiddle" src="{{$LAYOUT_HELPER_URL}}front/images/icons/purchase.png">
					<span>Xác thực&nbsp;&nbsp;</span>		 
				</div>       		
			</div>
			<div class="box-content-square-content" id="data-grid">
				<table width="100%" cellspacing="0" cellpadding="0" border="0">
                		<thead>
                                <tr>
                                   <th width="30" class="title-box-table"><input class="check-all" type="checkbox" /></th>
                                   <th width="60" class="title-box-table">Mã GD</th>
                                   <th width="95" class="title-box-table">Thời gian</th>
                                   <th width="70" class="title-box-table">Loại</th>
                                   <th width="135" class="title-box-table">Đối tác</th>
                                   <th width="85" class="title-box-table">Số tiền</th>
                                   <th width="70" class="title-box-table">Trạng thái</th>
                                   <th width="70" class="title-box-table">Thao tác</th>
                                </tr>
                		</thead>
                        {{if  $allTransactions|@count > 0 }}
                        <tbody>
                            
                            {{foreach from=$allTransactions item=item}}
                                <tr>
                                    <td class="center"><input type="checkbox" value="{{$item.transaction_id}}" name="allTransactions"/></td>
                                    <td  class="center">#{{$item.id_format}}</td>
                                    <td  class="center">{{$item.created_date}}</td>
                                    <td  class="center">{{$item.type_name}}</td>
                                    <td  class="center">{{$item.to_name}}</td>
                                    <td  class="center">{{$item.amount_format}}</td>
                                    <td class="center">
                                        {{if $item.approved == '1'}}
                                            <img src="{{$LAYOUT_HELPER_URL}}front/images/icons/visible16x16.png" alt="Đã xác thực" title="Đã xác thực">
                                        {{else}}
                                            <img src="{{$LAYOUT_HELPER_URL}}front/images/icons/invisible16x16.png" alt="Chưa xác thực" title="Chưa xác thực">
                                        {{/if}}
                                    </td>
                                    <td class="center">
										{{if $item.approved == '1'}}  
											 <a href="{{$APP_BASE_URL}}transaction/index/detail/tid/{{$item.transaction_id}}" title="Xem chi tiết"><img src="{{$LAYOUT_HELPER_URL}}front/images/icons/view_detail.png"  alt="Xem chi tiết" /></a> 	 
										{{else}}
											<a href="{{$APP_BASE_URL}}transaction/index/authen-payment/tid/{{$item.transaction_id}}" title="Xác thực"><img src="{{$LAYOUT_HELPER_URL}}front/images/icons/purchase.png"  alt="Xác thực" /></a>
										{{/if}}                                	
                                    </td>
                                </tr>
                            {{/foreach}}    
                       </tbody>
                       {{else}}
                       <tbody>
	                       	<tr class="data-empty">
							  <td align="center" colspan="9">Không tồn tại giao dịch nào!</td>
							</tr>
						</tbody>
                       {{/if}}
                </table>
			
			</div>
			  
			<!-- BEGIN BlockPaging -->
			<div class="button-box-buttom">
					<!-- PAGINATION -->
                        {{if $countAllPages > 1}}
                        <div style="float: right;">
                            {{if $first}}
                            <a href="?page=1" title="{{l}}First Page{{/l}}">&laquo; {{l}}First{{/l}}</a>
                            {{/if}}
                            {{if $prevPage}}
                            <a href="?page={{$prevPage}}" title="{{l}}Previous Page{{/l}}">&laquo;</a>
                            {{/if}}
                            
                            {{foreach from=$prevPages item=item}}
                            <a href="?page={{$item}}" title="{{$item}}">{{$item}}</a>
                            {{/foreach}}
                            
                            <a href="#" title="{{$currentPage}}">{{$currentPage}}</a>
                            
                            {{foreach from=$nextPages item=item}}
                            <a href="?page={{$item}}" title="{{$item}}">{{$item}}</a>
                            {{/foreach}}
                            
                            {{if $nextPage}}
                            <a href="?page={{$nextPage}}"  title="{{l}}Next Page{{/l}}">&raquo;</a>
                            {{/if}}
                            {{if $last}}
                            <a href="?page={{$countAllPages}}" title="{{l}}Last Page{{/l}}">{{l}}Last{{/l}} &raquo;</a>
                            {{/if}}
                        </div> <!-- End .pagination -->
                        {{/if}}
				<div class="clear"></div>
			</div>
			<!-- END BlockPaging -->
			
			</div>
	</div>
</div>